<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright (c) 2010 by the GPSD project
SPDX-License-Identifier: BSD-2-clause
-->
<!DOCTYPE refentry PUBLIC
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id='gpscat.1'>
<refentryinfo><date>16 Nov 2006</date></refentryinfo>
<refmeta>
<refentrytitle>gpscat</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="source">The GPSD Project</refmiscinfo>
<refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>gpscat</refname>
<refpurpose>dump the output from a GPS</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>

<cmdsynopsis>
  <command>gpscat</command>
      <arg choice='opt'>-s <replaceable>speed</replaceable></arg>
      <arg choice='opt'>-p</arg>
      <arg choice='opt'>-t</arg>
      <arg choice='opt'>-D <replaceable>debuglevel</replaceable></arg>
      <arg choice='plain'><replaceable>file-or-serial-port</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsect1 id='description'><title>DESCRIPTION</title>

<para><application>gpscat</application> is a simple program for
logging and packetizing GPS data streams.  It takes input from a
specified file or serial device (presumed to have a GPS attached) and
reports to standard output. The program runs until end of input or it is
interrupted by ^C or other means. It does not terminate on a bad
packet; this is intentional.</para>

<para>In raw mode (the default) <application>gpscat</application>
simply dumps its input to standard output.  Nonprintable characters
other than ASCII whitespace are rendered as hexadecimal string escapes.</para>

<para>In packetizing mode, <application>gpscat</application> uses the
same code as
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
packet sniffer to break the input into packets.  Packets are reported
one per line; line breaks in the packets themselves are
escaped.</para>

<para>This program is useful as a sanity checker when examining a new
device.  It can be used as a primitive NMEA logger, but beware that
(a) interrupting it likely to cut off output in mid-sentence, and (b)
to avoid displaying incomplete NMEA sentences right up next to shell
prompts that often contain a $, raw mode always emits an extra final
linefeed.</para>

<para>Also, be aware that packetizing mode will produce useless
results &mdash; probably consuming the entirety of input and appearing
to hang &mdash; if it is fed data that is not a sequence of packets
of one of the known types.</para>

<para>The program accepts the following options:</para>
<variablelist remap='TP'>

<varlistentry>
<term>-p</term>
<listitem>
<para>Invoke packetizer mode.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-s</term>
<listitem>
<para>Set the port's baud rate (and optionally its parity and stop
bits) before reading.  Argument should begin with one of the normal integer
baud rates (300, 1200, 4800, 9600, 19200, 38400, etc.).  It may be
followed by an optional suffix [NOE][12] to set parity (None, Odd,
Even) and stop bits (1 or 2).</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-t</term>
<listitem>
<para>Invoke packetizer mode, with the packet type and length (in
parentheses) reported before a colon and space on each line.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-D</term>
<listitem>
<para>In packetizer mode, enable progress messages from the packet
getter.  Probably only of interest to developers testing packet
getter changes.  Higher arguements to D produce more output.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-h</term>
<listitem>
<para>Display program usage and exit.</para>
</listitem>
</varlistentry>
</variablelist>

<para>Specifying -s 4800N1 is frequently helpful with unknown
devices.</para>

</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgpsmm</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
<citerefentry><refentrytitle>gpsprof</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsdctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsmon</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsect1>

<refsect1 id='maintainer'><title>AUTHOR</title>

<para>Eric S. Raymond <email>esr@thyrsus.com</email>.</para>
</refsect1>
</refentry>
